#ifndef __FILESYSTEM_H__
#define	__FILESYSTEM_H__

#include "superblock.h"
#include "freelistblock.h"
#include "inodeblock.h"
#include "directoryblock.h"
#include "indirectblock.h"
#include <vector>
#include "iostream"


class FileSystem
{
	public:
		static FileSystem* instance();
		virtual ~FileSystem();
		virtual void print();
		void mountFS(const char *);
		std::vector<InodeBlock*> * inodeBlocks;
		std::vector<FreeListBlock*> * freeListBlocks;
		std::vector<Inode*> getInodesFromDir( std::string );
		void loadSuperBlock();
		void loadInodeBlocks();
		void loadFreeListBlocks();
		void processInode(int);
		int findInode(int, std::string);
		std::string getAbsolutePath(int, int);
		bool processPath(std::string);
		void dumpDirTree();
		void dumpInodeTree();
		void listDir(Inode*);
		void showData(Inode*);

	private:
		FileSystem();
		static FileSystem* onlyInstance_;
		FILE* device;
		SuperBlock* superBlock;
};

#endif

